package com.iplay.实战java高并发程序设计;

import com.google.common.util.concurrent.MoreExecutors;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Vector;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Function;

/**
 * @author dangwu
 * @since 2021/10/27 5:20 下午
 */
public class TestCase {
    public static ReentrantLock lock = new ReentrantLock();

    public static void main(String[] args) {
        int num = 2;
        Function<Integer,Integer> stringConverter = (from) -> from*num;
        Function<Integer,Integer> sc = (from) -> from+1;
//        System.out.println(stringConverter.apply(3));
        System.out.println(stringConverter.compose(sc).apply(3));
        System.out.println(stringConverter.andThen(sc).apply(3));
    }
}
